<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Serenity
 * Date: 23-6-11
 * Time: 9:31
 * To change this template use File | Settings | File Templates.
 */

class FormValidation
{


    public static function stripInput()
    {
        if (get_magic_quotes_gpc()) {
            $in = array(&$_GET, &$_POST, &$_COOKIE);
            while (list($k, $v) = each($in)) {
                foreach ($v as $key => $val) {
                    if (!is_array($val)) {
                        $in[$k][$key] = htmlspecialchars(strip_tags(stripslashes($val)));
                        continue;
                    }
                    $in[] =& $in[$k][$key];
                }
            }
            unset($in);
        }
    }

}
